package com.googlecode.grima.base;

import javax.servlet.http.HttpServletRequest;

public class Page {

	public Page(){
	}
	
	public Page(HttpServletRequest request) {
		
		this.pageNumber = 1;
		this.pageSize = 10;
		
		String pageNumber = request.getParameter("pageNumber");
		String pageSize = request.getParameter("pageSize");

		if (pageNumber != null){
			this.pageNumber = Integer.valueOf(pageNumber);
		}
		if (pageSize != null){
			this.pageSize = Integer.valueOf(pageSize);
		}

	}
	
	private int pageNumber;
	private int pageSize;

	public int getPageNumber() {
		return pageNumber;
	}

	public void setPageNumber(int pageNumber) {
		this.pageNumber = pageNumber;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	
}
